package com.lanou3g.bookstore.util.upload;

import java.util.UUID;

/**
 * Created by dllo on 18/5/15.
 */

/**
 * 获取UUID随机名字 共32位
 */
public class UU {
    public static String getUUID() {
        String uuid = UUID.randomUUID().toString().replace("-", "").toUpperCase();
        return uuid;
    }

    //原文件名传进来
    public static String getLoadName(String fileName) {
        String name = getUUID();
        int lastIndex = fileName.lastIndexOf(".");
        String expand = fileName.substring(lastIndex, fileName.length());
        return name + expand;
    }
}
